#include "apue.h"

//int ftw(const char *dir, int (*fn) (const *file, const struct stat *sb, int flag), int depth)

int func(const char *path, const struct stat *sb, int flag) {
	printf("%s\n", path);
}

int main(void) {
	if (ftw("./foo", func, 500) < 0) {
		err_sys("ftw error");
	} else {
		printf("ftw succeed.\n");
	}
	exit(0);
}

